/*
 * @Author: thinker_cy
 * @Date: 2025-11-04 11:23:22
 * @FilePath: \weimai-admin\src\api\article\index.js
 * @Description: 
 */
import request from '@/config/axios'

// 所有文章 API
export const ArticleApi = {
  // 查询所有文章分页
  getArticlePage: async (params) => {
    return await request.get(`/article/page`, { params })
  },

  // 查询所有文章详情
  getArticle: async (id) => {
    return await request.get(`/article/get?id=` + id)
  },

  // 新增所有文章
  createArticle: async (data) => {
    return await request.post(`/article/create`, data)
  },

  // 修改所有文章
  updateArticle: async (data) => {
    return await request.post(`/article/update`, data)
  },

  // 删除所有文章
  deleteArticle: async (id) => {
    return await request.delete(`/article/delete?id=` + id)
  },

  // 导出所有文章 Excel
  exportArticle: async (params) => {
    return await request.get(`/article/export-excel`, { params })
  },

  // 查询所有文章分页 产品亮点 应用案例
  getArticleItemPage: async (params) => {
    return await request.get(`/article-item/page`, { params })
  },

  // 产品亮点 应用案例
  createArticleItem: async (data) => {
    return await request.post(`/article-item/create`, data)
  },
  
  // 修改所有文章
  updateArticleItem: async (data) => {
    return await request.post(`/article-item/update`, data)
  },

  // 删除所有文章
  deleteArticleItem: async (id) => {
    return await request.delete(`/article-item/delete?id=` + id)
  },
}